import type { ProColumns } from '@ant-design/pro-table';
import { Input } from 'antd';


export type columnsDataType = {
  actionCode: string;
  actionName: string;
  createdBy: string;
  createdTime: Date;
  effTm: Date;
  effectiveDay: number;
  failTm: Date;
  point: number;
  remark: string;
  seqNo: number
  status: string;
  updatedBy: string;
  updatedTime: Date;
};
const columnsData: ProColumns<columnsDataType>[] = [

  // 配置搜索框
  {
    title: '积分规则编号',
    dataIndex: 'actionCode',
    hideInTable: true,
    fieldProps: {
      maxLength: 20
    },
  },
  {
    title: '规则状态',
    dataIndex: 'status',
    valueType: 'select',
    hideInTable: true,
    valueEnum: {
      1: {
        text: '失效',
        status: 'Error',
      },
      0: {
        text: '生效',
        status: 'Success',
      }
    },
  },
  {
    title: '激励分值',
    dataIndex: 'point',
    valueType: 'digit',
    hideInTable: true,
    fieldProps: {
      maxLength: 20
    },
  },
  {
    title: '生效日期',
    dataIndex: 'effectiveDate',
    colSize: 1,
    valueType: 'dateRange',
    hideInTable: true,
    search: {
      transform: (value) => {
        return {
          startDate: value[0],
          endDate: value[1],
        };
      },
    },
  },

  // table里面的内容
  {
    title: '序号',
    dataIndex: 'order',
    valueType: 'indexBorder',
    width: 50,
    fixed: 'left',
  },
  {
    title: '积分规则编号',
    dataIndex: 'actionCode',
    hideInSearch: true,
    width: 180,
    fixed: 'left',
  },
  {
    title: '行为名称',
    dataIndex: 'actionName',
    hideInSearch: true,
    width: 160,
  },
  {
    title: '激励分值',
    dataIndex: 'point',
    hideInSearch: true,
    width: 100,
  },
  {
    title: '有效期(天)',
    dataIndex: 'availableDay',
    hideInSearch: true,
    width: 100,
  },
  {
    title: '生效时间',
    dataIndex: 'activateTime',
    valueType: 'dateTime',
    colSize: 1.5,
    hideInSearch: true,
    width: 160,
  },
  {
    title: '失效时间',
    dataIndex: 'expireTime',
    valueType: 'dateTime',
    hideInSearch: true,
    width: 160,
  },
  {
    title: '规则状态',
    dataIndex: 'status',
    valueType: 'select',
    hideInSearch: true,
    width: 100,
    valueEnum: {
      1: {
        text: '失效',
        status: 'Error',
      },
      0: {
        text: '生效',
        status: 'Success',
      }
    },
  },
  {
    title: '规则描述',
    hideInSearch: true,
    dataIndex: 'remark',
    width: 180,
  },
  {
    title: '操作',
    width: 80,
    hideInSearch: true,
    dataIndex: 'action',
    fixed: 'right',
  },
];

export default columnsData;